#ifndef DOUBAN_DATA_DOUMAIL_H
#define DOUBAN_DATA_DOUMAIL_H
#include "douban_global.h"
#include "DoubanUser.h"
namespace Douban
{
	class Doumail
	{
		public:
		Doumail(DoubanId id,const QString& title,const QString& time, DoubanUser s,const QString& senderName):
				b_hasContent(false),
				b_read(false),
				b_abandoned(false),
				b_isViewing(false),
				i_id(id),
				m_sender(s),
				s_title(title),
				s_senderName(senderName),
				s_time(time){}

			DoubanId id()				const { return i_id; }
			const DoubanUser& sender()	const { return m_sender; }
			bool hasContent()			const { return b_hasContent; }
			const QString& time()		const { return s_time; }
			const QString& title()		const { return s_title; }
			const QString& mailContent()	const { return s_content; }
			const QString& senderName()	const { return s_senderName; }
			void setContent(QString c)	const { s_content = c;b_hasContent = true; }
			void setRead(bool b)			const { b_read = b; }
			bool isRead()				const { return b_read; }

			bool isViewing()			const { return b_isViewing; }
			void setIsViewing(bool v)	const { b_isViewing = v; }
			void setAbandoned()			const { b_abandoned = true; }
			bool isAbandoned()			const { return b_abandoned; }
		private:
			Doumail(const Doumail&);
			Doumail& operator=(const Doumail&);

			mutable bool	b_hasContent;
			mutable bool	b_read;
			mutable bool	b_abandoned;
			mutable bool	b_isViewing;
			mutable QString	s_content;
			DoubanId		i_id;
			DoubanUser		m_sender;
			QString			s_title;
			QString			s_senderName;
			QString			s_time;
	};
}
#endif // DOUMAIL_H
